Keywords in C
• Every C Word is classified as Keyword or Identifier
• Keywords are C tokens that have a strict meaning.
– They are explicitly reserved and cannot be redefined.
– ANSI C has 32 key words.
• Keywords serve basic building blocks for program statement.
C Keywords
auto do goto signed unsigned
break double if sizeof void
case else int static volatile
char enum long struct while
const extern register switch
continue float return typedef
default for short union
Keyword and there Function
01. auto - Defines automatic storage duration (default for local variables).
02. reak - Exits a loop or switch statement.
03. case - Used in a switch statement to define possible choices.
04. char - Declares a character variable.
05. const - Defines a constant value.
06. continue - Skips the current iteration of a loop and moves to the next.
07. default - Specifies the default case in a switch statement.
08. do - Begins a do-while loop.
09. double - Declares a variable that can hold double-precision floating-point numbers.
10. else - Defines the else part of an if-else statement.
11. enum - Defines an enumeration type.
12. extern - Declares a variable or function that is defined elsewhere.
13. float - Declares a variable for floating-point numbers.
14. for - Begins a for loop.
15. goto- Transfers control to another part of the program (not recommended in modern code).
16. if - Begins an if statement for conditional logic.
17. inline - Suggests to the compiler to attempt to inline a function.
18. int - Declares a variable for integers.
19. long - Declares a long integer.
20. register- Suggests storing a variable in a processor register (rarely used).
21. return- Returns a value from a function.
22. short - Declares a short integer.
23. signed - Specifies that a variable can hold both positive and negative numbers.
24. sizeof - Returns the size of a data type or variable.
25. static- Defines a variable or function with a static lifespan, i.e., it retains its value across function calls.
26. struct- Defines a structure (a collection of variables).
27. switch- Begins a switch statement for conditional branching.
28. typedef - Defines a new name for an existing data type.
29. union- Defines a union (a data structure where all members share the same memory).
30. unsigned - Specifies that a variable can only hold positive values.
31. void- Specifies that a function does not return a value or a pointer to a generic type.
32. volatile - Specifies that a variable can be changed outside the program (e.g., by hardware).
33. while- Begins a while loop.